import { createRouter, createWebHistory } from 'vue-router';
import StartPage from '../views/StartPage.vue';
import Login from '../views/Login.vue';
import CropRecognition from '../views/CropRecognition.vue';
import ExpertAnalysis from '../views/ExpertAnalysis.vue';
import KnowledgeBase from '../views/KnowledgeBase.vue';
import HomePage from '../views/HomePage.vue';
import AgricultureMap from '../views/AgricultureMap.vue';
import AgricultureNews from '../views/AgricultureNews.vue';
import AgricultureNewsDetails from '../views/AgricultureNewsDetails.vue'; // 新增的详情组件
import MyPage from '../views/MyPage.vue'; // 确保路径正确
import Pdreports from "@/views/Pdreports.vue";
import Ddreports from "@/views/Ddreports.vue";
import Password from "@/views/Password.vue";
import Feedback from "@/views/Feedback.vue";
import BottomNav from '@/views/BottomNav.vue';
import ScanPage from "@/views/ScanPage.vue";
import GrasshopperDetail from '@/views/GrasshopperDetail.vue';
import ChatPage from '../views/ChatPage.vue'; // 引入 ChatPage 组件


const routes = [
  { path: '/', component: StartPage },
  { path: '/login', component: Login },
  { path: '/homepage', component: HomePage },
  { path: '/map', component: AgricultureMap },
  { path: '/news', component: AgricultureNews },
  { path: '/news/:id', component: AgricultureNewsDetails }, // 新闻详情的路由
  { path: '/my', component: MyPage }, // 新增“我的”页面路由
  { path: "/Pdreports",component: Pdreports,},
  { path: "/Ddreports",component: Ddreports,},
  { path: "/password",component: Password,},
  { path: "/feedback",component: Feedback,},
  { path: '/scan', component: ScanPage },
  { path: '/disease/1',name: 'GrasshopperDetail',component: GrasshopperDetail},
  { path: '/chat',name: 'ChatPage',component: ChatPage},
  // 其他路由配置


];

const router = createRouter({
  history: createWebHistory(),
  routes
});

export default router;
